<ui:composition
  xmlns="http://www.w3.org/1999/xhtml"
  xmlns:h="http://java.sun.com/jsf/html"
  xmlns:ui="http://java.sun.com/jsf/facelets"
  xmlns:c="http://java.sun.com/jstl/core">

  <c:if test="false">
    Parameters:
    - safeEdit_message: warning message
  </c:if>

  <c:if test="#{safeEdit_message==null}">
    <c:set var="safeEdit_message" value="safeedit.page.has.unsaved.changes" />
  </c:if>

  <h:outputScript src="/scripts/safeEdit.js" target="#{pageJsBodyStartTarget}" />
  <h:outputScript src="/scripts/safeEditUI.js" target="#{pageJsBodyStartTarget}" />

  <h:outputScript target="#{pageJsBodyStartTarget}">
    var nuxeo = (function(nuxeo) {
      nuxeo.safeEdit = {
        restorePrompt: {
          message: "#{messages['safeedit.recovereddata.prompt']}",
          confirmMessage: "#{messages['safeedit.recover.yes']}",
          discardMessage: "#{messages['safeedit.recover.no']}"
        },
        feedbackMessage: "#{messages['safeedit.saved']}",
        unsavedChangesMessage: "#{messages['safeedit.page.has.unsaved.changes']}",
      };
      return nuxeo;
    })(nuxeo || {});
  </h:outputScript>

</ui:composition>